# -*- coding:utf-8 -*-
class Solution:
    def Add(self, num1, num2):
        # write code here
        carry = 1
        while carry:
            s = num1 ^ num2
            carry = 0xFFFFFFFF & ((num1 & num2) << 1)
            carry = -(~(carry - 1) & 0xFFFFFFFF) if carry > 0x7FFFFFFF else carry
            num1 = s
            num2 = carry
        return num1